home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991 …esperately Seeking Seven / Desperately Seeking Seven.2mg / Dev.CD.8 / Essentials / Tools / File.Type.Notes / FTN.1B.XXXX < prev    next >
Encoding:
Text File  |  1989-08-04  |  27.0 KB  |  559 lines  |  [04] ASCII Text (0x0000)

  1. Apple II
  2. File Type Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. File Type:         $1B (27)
  8. Auxiliary Type:    All
  9.  
  10. Full Name:     AppleWorks Spreadsheet File
  11. Short Name:    AppleWorks SS File
  12.  
  13. Revised by:    Matt Deatherage & John Kinder, CLARIS Corp.     September 1989
  14. Written by:    Bob Lissner    February 1984
  15.  
  16. Files of this type and auxiliary type contain an AppleWorks(R) Spreadsheet 
  17. file.
  18. Changes since May 1989:  Updated to include AppleWorks 2.1 and AppleWorks 
  19. 3.0.
  20. _____________________________________________________________________________
  21.  
  22. Files of type $1B and any auxiliary type contain an AppleWorks Spreadsheet 
  23. file.  AppleWorks is published by CLARIS.  CLARIS also has additional 
  24. information on AppleWorks files SEG.PR and SEG.ER.  For information on 
  25. AppleWorks, contact CLARIS at:
  26.  
  27.                     CLARIS Corporation
  28.                     5201 Patrick Henry Drive
  29.                     P.O. Box 58168
  30.                     Santa Clara, CA 95052-8168
  31.  
  32.                     Technical Support
  33.                     Telephone:  (408) 727-9054
  34.                     AppleLink:  Claris.Tech
  35.  
  36.                     Customer Relations
  37.                     Telephone:  (408) 727-8227
  38.                     AppleLink:  Claris.CR
  39.  
  40. AppleWorks was created by Bob Lissner.  AppleWorks 2.1 was done by Bob Lissner 
  41. and John Kinder of CLARIS.  AppleWorks 3.0 was done by Rob Renstrom, Randy 
  42. Brandt and Alan Bird of Beagle Bros Software with John Kinder of CLARIS.
  43.  
  44.  
  45. Definitions
  46.  
  47. The following definitions apply to AppleWorks files in addition to those 
  48. defined for all Apple II file types:
  49.  
  50.     MRL    Data base multiple record layout
  51.     SRL    Data base single record layout
  52.     RAC    Review/Add/Change screen
  53.     DB     AppleWorks or /// E-Z Pieces Data Base
  54.     SS     AppleWorks or /// E-Z Pieces Spreadsheet
  55.     WP     AppleWorks or /// E-Z Pieces Word Processor
  56.     AW     AppleWorks or /// E-Z Pieces
  57.  
  58.  
  59. Auxiliary Type Definitions
  60.  
  61. The volume or subdirectory auxiliary type word for this file type is defined 
  62. to control uppercase and lowercase display of filenames.  The highest bit of 
  63. the least significant byte corresponds to the first character of the filename, 
  64. the next highest bit of the least significant byte corresponds to the second 
  65. character, etc., through the second bit of the most significant byte, which 
  66. corresponds to the fifteenth character of the filename.
  67.  
  68. AppleWorks performs the following steps when it saves a file to disk:
  69.  
  70.   1.  Zeros all 16 bits of the auxiliary type word.
  71.   2.  Examines the filename for lowercase letters.  If one is found, it 
  72.       changes the corresponding bit in the auxiliary type word to 1 and 
  73.       changes the letter to uppercase.
  74.   3.  Examines the filename for spaces.  If one is found, it changes the 
  75.       corresponding bit in the auxiliary type word to 1 and changes the 
  76.       space to a period.
  77.  
  78. When files are read from disk, the filename and auxiliary type information 
  79. from the directory file entry are used to determine which characters should be 
  80. lowercase and which periods should be displayed as spaces.  If you use the 
  81. auxiliary type bytes for a different purpose, AppleWorks will still display 
  82. the filenames, but the wrong letters are likely lowercase.
  83.  
  84.  
  85. File Version Changes
  86.  
  87. Certain features present in AppleWorks 3.0 files are not backward-compatible 
  88. to 2.1 and earlier versions.  Such features are noted in the text.  AppleWorks 
  89. spreadsheet files which may not be loaded by versions prior to 3.0 are 
  90. identified by a non-zero byte at location +242, referred to as location 
  91. SSMinVers.
  92.  
  93. Those features added for AppleWorks 2.0, 2.1 and 3.0 not previously documented 
  94. are indicated with that version number in the margin.
  95.  
  96.  
  97. Spreadsheet Files
  98.  
  99. Spreadsheet files start with a 300 byte header record that contains basic 
  100. information about the file, including column widths, printer options, window 
  101. definitions, and standard values.
  102.  
  103. Header Record
  104.  
  105. The spreadsheet header record contains the following entries:
  106.  
  107. +000 to +003                Skip 4 bytes.
  108. +004 to +130       Bytes    The column width for each column.
  109. +131               Byte     Order of recalculation.  ASCII R or C.
  110. +132               Byte     Frequency of recalculation.  ASCII A 
  111.                             or M.
  112. +133 to +134       Word     Last row referenced.
  113. +135               Byte     Last column referenced.
  114. +136               Byte     Number of windows:  ASCII 1:  just 
  115.                             one window, S: side by side windows, 
  116.                             T: top and bottom windows.
  117. +137               Byte     Boolean:  If there are two windows, 
  118.                             are they synchronized?
  119. +138 to +161                The next 20 (approximately) 
  120.                             variables are for the current 
  121.                             window.  If there is only one 
  122.                             window, it is the current window.  
  123.                             If there are two windows, the 
  124.                             current window is the window that 
  125.                             had the cursor in it.
  126. +138               Byte     Window standard format for label 
  127.                             cells.  2: left justified, 3: right 
  128.                             justified, 4: centered.
  129. +139               Byte     Window standard format for value 
  130.                             cells.  2: fixed, 3: dollars, 4: 
  131.                             commas, 5: percent, 6: appropriate
  132. +140               Byte     More of window standard format for 
  133.                             value cells.  Number of decimal 
  134.                             places to display.  Values from 0 to 7.
  135. +141               Byte     Top screen line used by this window.  
  136.                             This is the line that the 
  137.                             =====A=========B==== appears on.  
  138.                             Normally 1 unless there are top and 
  139.                             bottom windows.
  140. +142               Byte     Leftmost screen column used by this 
  141.                             window.  This is the column that the 
  142.                             hundreds digit of the row number 
  143.                             appears in.  Normally 0 unless there 
  144.                             are side-by-side windows.
  145. +143 to +144       Word     Top, or first, row appearing in 
  146.                             titles area.  This will probably be 
  147.                             0 if there are no top titles.
  148. +145               Byte     Leftmost, or first, column appearing 
  149.                             in left titles area.  This will 
  150.                             probably be 0 if there are no left 
  151.                             titles.
  152. +146 to +147       Word     Last row appearing in top titles 
  153.                             area.  This will probably be zero if 
  154.                             there are no top titles.
  155. +148               Byte     Last column appearing in left titles 
  156.                             area. This will probably be zero if 
  157.                             there are no left titles.
  158. +149 to +150       Word     Top, or first, row appearing in the 
  159.                             body of the window.  The body is 
  160.                             defined as those rows that are on 
  161.                             the screen, but not in the titles 
  162.                             area.
  163. +151               Byte     Leftmost, or first, column appearing 
  164.                             in the body of the window.
  165. +152               Byte     The screen line that the top body 
  166.                             row goes on.  Normally 2, unless 
  167.                             there are top titles or top and 
  168.                             bottom windows.
  169. +153               Byte     Leftmost screen column used for the 
  170.                             leftmost body column.  Normally 4 
  171.                             unless there are side titles, or 
  172.                             side-by-side windows.
  173. +154 to +155       Word     Bottom, or last, row appearing in 
  174.                             this window.
  175. +156               Byte     Rightmost, or last, column appearing 
  176.                             in this window.
  177. +157               Byte     The screen line that the last body 
  178.                             row goes on.  Normally $13 (19) 
  179.                             unless there are top and bottom 
  180.                             windows.
  181. +158               Byte     The rightmost screen column used by 
  182.                             this window.  Normally $4E (78) 
  183.                             unless there are side-by-side 
  184.                             windows.
  185. +159               Byte     Number of horizontal screen 
  186.                             locations used to display the body 
  187.                             columns.  Normally $48 (72), because 
  188.                             8 columns of 9 characters each are 
  189.                             the standard display.  This is 
  190.                             affected by side-by-side windows, 
  191.                             side titles, and variable column 
  192.                             widths.
  193. +160               Byte     Boolean:  Rightmost column is not 
  194.                             fully displayed.  This can only 
  195.                             happen when the body portion of the 
  196.                             window is narrower than the width of 
  197.                             a particular column.
  198. +161          Flag Byte     Titles switch for this window.  Bit 
  199.                             7:  top titles, Bit 6:  side titles.  
  200.                             These bits represent top titles, 
  201.                             side titles, both, and no titles.
  202. +162 to +185                Window information for the second 
  203.                             window.  This is meaningful only if 
  204.                             there are two windows.  This is the 
  205.                             information for the window that the 
  206.                             cursor is not currently in.  See the 
  207.                             descriptions for the current window 
  208.                             (+138 to +161).
  209. +186 to +212                Not currently used.
  210. +213               Byte     Boolean:  Cell protection is on or off.
  211. +214                        Not currently used.
  212. +215               Byte     Platen width value, in 10ths of an 
  213.                             inch.  For example, a value of 80 
  214.                             inches entered by the user will show 
  215.                             as 80 or $50.
  216. +216               Byte     Left margin value.  All inches 
  217.                             values are in 10ths of an inch.
  218. +217               Byte     Right margin value.
  219. +218               Byte     Characters per inch.
  220. +219               Byte     Paper length value, in 10ths of an 
  221.                             inch.
  222. +220               Byte     Top margin value.
  223. +221               Byte     Bottom margin value.
  224. +222               Byte     Lines per inch.  6 or 8.
  225. +223               Byte     Spacing:  S(ingle, D(ouble, or 
  226.                             T(riple.  Expect these three 
  227.                             letters, even in European versions.
  228. +224 to +237       Bytes    If user has specified "Send special 
  229.                             codes to printer," this is a 13-byte 
  230.                             string containing those codes.
  231. +238               Byte     Boolean:  Print a dash when an entry 
  232.                             is blank.
  233. +239               Byte     Boolean:  Print report header.
  234. +240               Byte     Boolean:  Zoomed to show formulas.
  235. 2.1 +241           Byte     Reserved; used internally.
  236. 3.0 +242           Byte     SSMinVers.  The minimum version of 
  237.                             AppleWorks needed to read this 
  238.                             document.  If this document contains 
  239.                             version 3.0-specific functions (such 
  240.                             as calculated labels or new 
  241.                             functions), this byte will contain 
  242.                             the version number 30 ($1E).  
  243.                             Otherwise, it will be zero ($00).
  244. +243 to +249                Reserved for future use.
  245. +250 to +299                Available.  Will never be used by 
  246.                             AppleWorks.  If you are creating 
  247.                             these files, you can use this area 
  248.                             to keep information that is 
  249.                             important to your program.
  250.  
  251. Row Records
  252.  
  253. Row records contain a variable amount of information about each row that is 
  254. non-blank.  Each row record contains enough information to completely build 
  255. one row of the spreadsheet:
  256.  
  257. 3.0 +000 to +001   Word     Number of additional bytes to read 
  258.                             from disk.  $FFFF means end of file.  
  259.                             If SFMinVers is not zero, these two 
  260.                             bytes are invalid and should be 
  261.                             skipped.  The first row record 
  262.                             begins at +302 in an AW 3.0 SS file.
  263. +002 to +003       Word     Row number.
  264. +004               Byte     Beginning of actual information for 
  265.                             the row.  This byte of each record 
  266.                             will always be a control byte.  
  267.                             Other control bytes within each 
  268.                             record define the contents of the 
  269.                             record.  Control bytes may be:
  270.  
  271.                             $01-$7F    This is a count of the 
  272.                                        number of following 
  273.                                        bytes that are the 
  274.                                        contents of a cell 
  275.                                        entry.
  276.                             $81-$FE    This (minus $80) is a 
  277.                                        count of the number of 
  278.                                        columns to be skipped.  
  279.                                        For example, $82 means 
  280.                                        skip two columns.
  281.                             $FF        This indicates the end 
  282.                                        of the row.
  283.  
  284. Cell Entries
  285.  
  286. Cell entries contain all the information that is necessary to build one cell.  
  287. There are several types:
  288.  
  289. Value Constants
  290.  
  291. Value constants are cells that have a value that cannot change.  This means 
  292. that someone typed a constant into the cell, 3.14159, for example.
  293.  
  294. +000          Flag Byte     Bit 7 is always on.
  295.                             Bit 6 on means that if the value is zero, 
  296.                             display a blank instead of a zero.  This 
  297.                             is for pre-formatted cells that still have 
  298.                             no value.
  299.                             Bit 5 is always on.
  300.                             Bit 4 on means that labels cannot be typed 
  301.                             into this cell.
  302.                             Bit 3 on means that values cannot be typed 
  303.                             into this cell.
  304.                             Bits 2,1, and 0 specify the formatting for 
  305.                             this cell:
  306.  
  307.                                 1    Use spreadsheet standard
  308.                                 2    Fixed
  309.                                 3    Dollars
  310.                                 4    Commas
  311.                                 5    Percent
  312.                                 6    Appropriate
  313.  
  314. +001          Flag Byte     Bit 7 is always zero.
  315.                             Bit 6 is always zero.
  316.                             Bit 5 is always zero.
  317.                             Bit 4 on indicates that this cell must be 
  318.                             calculated the next time this spreadsheet 
  319.                             is calculated, even if none of the 
  320.                             referenced cells are changed.  This bit 
  321.                             makes sense on for cells that have a 
  322.                             alculated formula.
  323.                             Bits 2, 1, and 0:  Number of decimal 
  324.                             places for fixed, dollars, commas, or 
  325.                             percent formats.
  326. +002 to +009                8-byte SANE double format floating point 
  327.                             number.
  328.  
  329. Value Labels
  330.  
  331. Note:  The entire Value Labels cell record entry requires AppleWorks 3.0 
  332.        or later.
  333.  
  334. Value labels are cells whose function has returned a label value.  Formulas 
  335. like @Lookup, @Choose and @IF can all return labels as their results.  
  336. Specific format:
  337.  
  338. +000          Flag Byte     Bit 7 is always one.
  339.                             Bit 6 on means not to display the cell.  
  340.                             This was originally intended for pre-
  341.                             formatted cells that still have no value.  
  342.                             If a value is placed in this cell, be sure 
  343.                             to turn this bit off.
  344.                             Bit 5 is always zero.
  345.                             Bits 4, 3, 2, 1, and 0 are the same as 
  346.                             regular label cells.
  347. +001          Flag Byte     Bit 7 is always one.
  348.                             Bit 6 set indicates the last evaluation of 
  349.                             this formula resulted in @NA.
  350.                             Bit 5 set indicates the last evaluation of 
  351.                             his formula resulted in @Error.
  352.                             Bit 4 on indicates that this cell must be 
  353.                             calculated the next time this spreadsheet 
  354.                             is calculated, even if none of the 
  355.                             referenced cells are changed. 
  356.                             Bit 3 is always one.
  357.                             Bits 2 - 0 are ignored.
  358. +002 to nnn        String   Pascal string containing characters to 
  359.                             display.
  360. +nnn+1 to xxx      Bytes    Various control bytes that are "tokens" 
  361.                             representing the formula that was typed by 
  362.                             the user.  They are defined below.
  363.  
  364. Value Formulas
  365.  
  366. Value formulas are cells that contain information that has to be evaluated.  
  367. Formulas like AA17+@sum(r19...r21) and @Error are examples.  Specific format:
  368.  
  369. +000          Flag Byte     Bit 7 is always on.
  370.                             Bit 6 on means to not display the cell.  
  371.                             This was originally intended for pre-
  372.                             formatted cells that still have no value.  
  373.                             If a value is placed in this cell, be sure 
  374.                             to turn off this bit.
  375.                             Bit 5 is always off.
  376.                             Bits 4, 3, 2, 1, and 0 are the same as 
  377.                             value constants.
  378. +001                        Bit 7 is always on.
  379.                             Bit 6 on indicates that the last 
  380.                             evaluation of this formula resulted in an 
  381.                             @NA.
  382.                             Bit 5 on indicates that the last 
  383.                             evaluation of this formula resulted in an 
  384.                             @Error.
  385.                             Bits 4, 2, 1, and 0 are the same as value 
  386.                             constants.
  387. +002 to +009                8-byte SANE double floating point number 
  388.                             that is the most recent evaluation of this 
  389.                             cell.
  390. +010 to nnn                 Various control bytes that are tokens 
  391.                             representing the formula that was entered 
  392.                             by the user.  They are:
  393.  
  394.                                    Byte    Means
  395.                                    ____________________________________
  396.                             3.0    $C0    @Deg
  397.                             3.0    $C1    @Rad
  398.                             3.0    $C2    @Pi
  399.                             3.0    $C3    @True
  400.                             3.0    $C4    @False
  401.                             3.0    $C5    @Not
  402.                             3.0    $C6    @IsBlank
  403.                             3.0    $C7    @IsNA
  404.                             3.0    $C8    @IsError
  405.                             3.0    $C9    @Exp
  406.                             3.0    $CA    @Ln
  407.                             3.0    $CB    @Log
  408.                             3.0    $CC    @Cos
  409.                             3.0    $CD    @Sin
  410.                             3.0    $CE    @Tan
  411.                             3.0    $CF    @ACos
  412.                             3.0    $D0    @ASin
  413.                             3.0    $D1    @ATan2
  414.                             3.0    $D2    @ATan
  415.                             3.0    $D3    @Mod
  416.                             3.0    $D4    @FV
  417.                             3.0    $D5    @PV
  418.                             3.0    $D6    @PMT
  419.                             3.0    $D7    @Term
  420.                             3.0    $D8    @Rate
  421.                             2.0    $D9    @Round
  422.                             2.0    $DA    @Or
  423.                             2.0    $DB    @And
  424.                                    $DC    @Sum
  425.                                    $DD    @Avg
  426.                                    $DE    @Choose
  427.                                    $DF    @Count
  428.                                    $E0    @Error (followed by 3 bytes 
  429.                                           of zero)
  430.                             3.0    $E1    @IRR
  431.                                    $E2    @If
  432.                                    $E3    @Int
  433.                                    $E4    @Lookup
  434.                                    $E5    @Max
  435.                                    $E6    @Min
  436.                                    $E7    @NA (followed by three 
  437.                                           bytes of zero)
  438.                                    $E8    @NPV
  439.                                    $E9    @Sqrt
  440.                                    $EA    @Abs
  441.                                    $EB    Not currently used
  442.                                    $EC    Not equal (<>)
  443.                                    $ED    greater than or equal to (>=)
  444.                                    $EE    less than or equal to (<=)
  445.                                    $EF    equals (=)
  446.                                    $F0    greater than (>)
  447.                                    $F1    less than (<)
  448.                                    $F2    comma (,)
  449.                                    $F3    exponentiation sign (^)
  450.                                    $F4    right parenthesis (")")
  451.                                    $F5    minus (-)
  452.                                    $F6    plus (+)
  453.                                    $F7    divide (/)
  454.                                    $F8    multiply (*)
  455.                                    $F9    left parenthesis ("(")
  456.                                    $FA    unary minus (-) i.e., -A3
  457.                                    $FB    (unary plus (+) i.e., +A3)
  458.                                    $FC    ellipses (...)
  459.                                    $FD    Next 8 bytes are SANE 
  460.                                           double number
  461.                                    $FE    Next 3 bytes are row, 
  462.                                           column reference
  463.                             3.0    $FF    Next n bytes are a Pascal 
  464.                                           string
  465.                                    ____________________________________
  466.  
  467. Three of the codes require special information.  Code $FD indicates that the 
  468. next 8 bytes are a SANE numerics package double precision floating point 
  469. number.  All constants within formulas are carried in this manner.
  470.  
  471. Code $FE indicates that the next three bytes point at a cell:
  472.  
  473. +000               Byte     $FE
  474. +001               Byte     Column reference.  Add this byte to the 
  475.                             column number of the current cell to get 
  476.                             the column number of the pointed at cell.  
  477.                             This value is sometimes negative, but Add 
  478.                             always works.
  479. +002 to +003       Word     Row reference.  Add this word to the row 
  480.                             number of the current cell to get the row 
  481.                             number of the pointed at cell.  This value 
  482.                             is sometimes negative, but Add always 
  483.                             works.
  484.  
  485. Code $FF indicates that the next bytes are a String, where the byte 
  486. immediately following the $FF contains the length.
  487.  
  488.  
  489. Propagated Label Cells
  490.  
  491. Propagated label cells are labels that place one particular ASCII character in 
  492. each position of a window.  Handy for visual effects like underlining.
  493.  
  494. +000          Flag Byte     Bit 7 is always zero.
  495.                             Bit 6 is meaningless.
  496.                             Bit 5 is always on.
  497.                             Bit 4 and bit 3 are protection, just like 
  498.                             value cells.
  499.                             Bits 2, 1, and 0 are meaningless.  Put a 1 
  500.                             here.
  501. +001               Byte     This is the actual character that is to be 
  502.                             put in each position in the cell.
  503.  
  504. Regular Label Cells
  505.  
  506. Regular label cells contain alphanumeric information, such as headings, names, 
  507. and other descriptive information.
  508.  
  509. +000          Flag Byte     Bits 7, 6, and 5 are always zero.
  510.                             Bits 4 and 3 are same as value cells.
  511.                             Bits 2, 1, and 0 determine cell 
  512.                             formatting:
  513.                             01    Use spreadsheet standard formatting
  514.                             02    Left justify
  515.                             03    Right justify
  516.                             04    Center
  517. +001 to +nnn       Bytes    ASCII characters that actually display.  
  518.                             The actual length was defined earlier in 
  519.                             the word that contained the actual number 
  520.                             of bytes to read from disk.
  521.  
  522.  
  523. File Tags
  524.  
  525. All AppleWorks files normally end with two bytes of $FF; tags are 
  526. anything after that.  Although File Tags were primarily designed by 
  527. Beagle Bros, they can be used by any application that needs to create or 
  528. modify an AppleWorks 3.0 file.
  529.  
  530. Because versions of AppleWorks before 3.0 stop at the double $FF, they 
  531. simply ignore tags.
  532.  
  533. The File Tag structure is as follows:
  534.  
  535. +000              Byte          Tag ID.  Should be $FF.
  536. +001              Byte          2nd ID byte.  These values will be 
  537.                                 defined and arbitrated by Beagle 
  538.                                 Bros Software.   Beagle may be 
  539.                                 reached at:
  540.  
  541.                                 Beagle Bros Inc
  542.                                 6215 Ferris Square, #100
  543.                                 San Diego, CA  92121
  544.  
  545. +002 to +003      Word          Data length.  If this is the last 
  546.                                 tag on the file, the low byte (+002) 
  547.                                 will be a count of the tags in this 
  548.                                 file, and the high byte (+003) will 
  549.                                 be $FF.
  550. +004 to nnn       Bytes         Actual tag data, immediately 
  551.                                 followed by the next four-byte tag 
  552.                                 ID.  These bytes do not exist for 
  553.                                 the last tag.
  554.  
  555. There is a maximum of 64 tags per file.  Each tag may be no larger than 
  556. 2K.
  557.  
  558. AppleWorks is a registered trademark of Apple Computer, Inc. licensed to 
  559. Claris Corporation.